package com.zlzxm.shoesmarket.net.repository;

import com.zlzxm.shoesmarket.net.RetrofitClient;
import com.zlzxm.shoesmarket.net.api.NoteApi;
import com.zlzxm.shoesmarket.net.request.RqNoteAdd;
import com.zlzxm.shoesmarket.net.respone.BaseResponse;
import com.zlzxm.shoesmarket.net.respone.RpNoteList;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Field;

/**
 * CREATE BY zlzxm ON 2021/5/14
 */
public class NoteRepository {

    NoteApi noteApi = RetrofitClient.create(NoteApi.class);

    public Observable<BaseResponse<RpNoteList>> list( String  billTime,
                                                      String  pageNum,
                                                      String  pageSize){

        return noteApi.list(billTime,pageNum,pageSize);
    }

    public  Observable<BaseResponse<String>> add(RqNoteAdd rqNoteAdd){

        return noteApi.add(rqNoteAdd.getBillTime(),rqNoteAdd.getInAndOutType(),
                rqNoteAdd.getMoney(), rqNoteAdd.getPurpose(), rqNoteAdd.getRemar());
    }

}
